package Io;

import java.io.FileInputStream;

/**
 * 字节流读取
 */
public class TestFileInputStream {
    public static void main(String[] args) throws Exception {
        FileInputStream is = new FileInputStream("src/main/java/Io/aaa.txt");
        //每次读取5个字节
        byte[] bytes = new byte[5];
        int len  ;
        while ((len = is.read(bytes)) != -1){
            String s = new String(bytes, 0, len);
            System.out.println(s);
        }
        is.close();
    }
}
